package com.sumainfor.pc.epc.feign;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.epc.fallback.GetUserInfoFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * @Author PuaChen
 * @Create 2018-11-08 15:36
 */
@FeignClient(name = "TANGNEST-ZUUL", fallback = GetUserInfoFallback.class)
public interface GetUserInfoFeign {
    /**
     * 调用Zuul 获取用户的信息 和部门名称
     *
     * @return Map结构数据
     */
    @PostMapping("/provider/getUser")
    JsonResult getUserInfo(@RequestBody Collection<String> ids);

    /**
     * 功能描述: 
     * 获取所有用户的编号和名称
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/5/16 10:16
     */
    @ResponseBody
    @GetMapping("/provider/user/getAllUserIdAndName")
    JsonResult getAllUserIdAndName();

    /**
     * 根据报修人编号获取维修工单中的报修人信息
     *
     * @param
     * @return
     */
    @GetMapping("/provider/getUserByRepairsId")
    JsonResult getUserByRepairsId(@RequestParam(value="ids") List<String> ids);

    @GetMapping("/key/getdeptController/getdeptByType")
    JsonResult getdeptByType(@RequestParam(value="params") Map<String,Object> params);

    /**
     * 获取所有的维修师傅角色的用户信息
     * @return
     */
    @PostMapping("/provider/selectRepairPeople")
    List<Map<String, Object>> getRepairPeople();

    /**
     * 功能描述: 
     * 根据用户编号获取用户资料
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/5/10 11:53
     */
    @ResponseBody
    @GetMapping("/provider/user/getUserMap")
    JsonResult getUserMap(@RequestParam Map<String,Object>params);

    @GetMapping("/provider/dept/getDeptList")
    List<Map<String, Object>> getDeptList(@RequestParam(value = "params") Map<String, Object> params);

    /**
     * 功能描述:
     * 获取所有服务中心
     * @Author zhlu
     * @Description //TODO
     * @Date 2019/5/16 16:47
     */
    @PostMapping("/provider/dept/getPostDeptList")
    List<Map<String, Object>> getPostDeptList(@RequestBody Map<String, Object> params);

}
